﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Collections;

namespace Longbow.Config
{
	internal class ConfigSupport
	{


		private ModuleLoadPolicy loadPolicy = null;

		public string[] GetModuleFileNames(string path, ModuleType moduleType)
		{
			if (Directory.Exists(path))
			{
				string[] result = Directory.GetFiles(path);
				if (this.loadPolicy != null)
				{
					ArrayList al = new ArrayList(result.Length);
					foreach (string fileName in result)
					{
						if (loadPolicy(fileName))
						{
							al.Add(fileName);
						}
					}
					result = (string[])al.ToArray();
					al.Clear();
					return result;
				}
				else
				{
					return result;
				}
			}
			return null;
		}


		public ConfigSupport()
		{
			
		}
	}
}
